/**
 * Generate time : 2011-06-27 16:28:55
 * Version : 1.0.1.V20070717
 */
package com.baosight.sczx.zm.ca.domain;

import com.baosight.iplat4j.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.ep.DaoEPBase;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.util.StringUtils;

/**
 * VZMCA23
 * 
 */
public class VZMCA23 extends DaoEPBase {

	private String fdKeyId = " ";
	private String fdDepartmentId = " ";
	private String fdDate = " ";
	private String fdFromDate = " ";
	private String fdToDate = " ";
	private String fdDataType = " ";
	private String displayName = " ";

	private String fdYear = " ";
	private String fdMonth = " ";
	private BigDecimal fdPlanSum = new BigDecimal("0");
	private BigDecimal fdActualSum = new BigDecimal("0");
	private BigDecimal fdRate = new BigDecimal("0");

	private String fdParentId = " ";
	private String fdName = " ";

	/**
	 * initialize the metadata
	 */
	public void initMetaData() {
		EiColumn eiColumn;

		eiColumn = new EiColumn("fdKeyId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName(" ");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdDepartmentId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName(" ");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdDate");
		eiColumn.setFieldLength(20);
		eiColumn.setDescName(" ");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdFromDate");
		eiColumn.setFieldLength(20);
		eiColumn.setDescName(" ");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdToDate");
		eiColumn.setFieldLength(20);
		eiColumn.setDescName(" ");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdDataType");
		eiColumn.setFieldLength(20);
		eiColumn.setDescName(" ");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("displayName");
		eiColumn.setFieldLength(256);
		eiColumn.setDescName(" ");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdYear");
		eiColumn.setFieldLength(4);
		eiColumn.setDescName(" ");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdMonth");
		eiColumn.setFieldLength(2);
		eiColumn.setDescName(" ");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdPlanSum");
		eiColumn.setType("N");
		eiColumn.setScaleLength(5);
		eiColumn.setFieldLength(15);
		eiColumn.setDescName(" ");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdActualSum");
		eiColumn.setType("N");
		eiColumn.setScaleLength(5);
		eiColumn.setFieldLength(15);
		eiColumn.setDescName(" ");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdRate");
		eiColumn.setType("N");
		eiColumn.setScaleLength(5);
		eiColumn.setFieldLength(15);
		eiColumn.setDescName(" ");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdParentId");
		eiColumn.setFieldLength(300);
		eiColumn.setDescName(" ");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdName");
		eiColumn.setFieldLength(30);
		eiColumn.setDescName(" ");
		eiMetadata.addMeta(eiColumn);

	}

	/**
	 * the constructor
	 */
	public VZMCA23() {
		initMetaData();
	}

	/**
	 * get the fdKeyId
	 * 
	 * @return the fdKeyId
	 */
	public String getFdKeyId() {
		return this.fdKeyId;
	}

	/**
	 * set the fdKeyId
	 */
	public void setFdKeyId(String fdKeyId) {
		this.fdKeyId = fdKeyId;
	}

	/**
	 * get the fdDepartmentId
	 * 
	 * @return the fdDepartmentId
	 */
	public String getfdDepartmentId() {
		return this.fdDepartmentId;
	}

	/**
	 * set the fdDepartmentId
	 */
	public void setfdDepartmentId(String fdDepartmentId) {
		this.fdDepartmentId = fdDepartmentId;
	}

	/**
	 * get the fdDate
	 * 
	 * @return the fdDate
	 */
	public String getFdDate() {
		return this.fdDate;
	}

	/**
	 * set the fdDate
	 */
	public void setFdDate(String fdDate) {
		this.fdDate = fdDate;
	}

	/**
	 * get the fdDate
	 * 
	 * @return the fdDate
	 */
	public String getFdFromDate() {
		return this.fdFromDate;
	}

	/**
	 * set the fdDate
	 */
	public void setFdFromDate(String fdFromDate) {
		this.fdFromDate = fdFromDate;
	}

	/**
	 * get the fdDate
	 * 
	 * @return the fdDate
	 */
	public String getFdToDate() {
		return this.fdToDate;
	}

	/**
	 * set the fdDate
	 */
	public void setFdToDate(String fdToDate) {
		this.fdToDate = fdToDate;
	}

	/**
	 * get the fdDataType
	 * 
	 * @return the fdDataType
	 */
	public String getFdDataType() {
		return this.fdDataType;
	}

	/**
	 * set the fdDataType
	 */
	public void setFdDataType(String fdDataType) {
		this.fdDataType = fdDataType;
	}

	/**
	 * get the displayName
	 * 
	 * @return the displayName
	 */
	public String getDisplayName() {
		return this.displayName;
	}

	/**
	 * set the displayName
	 */
	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}

	/**
	 * get the fdYear
	 * 
	 * @return the fdYear
	 */
	public String getFdYear() {
		return this.fdYear;
	}

	/**
	 * set the fdYear
	 */
	public void setFdYear(String fdYear) {
		this.fdYear = fdYear;
	}

	/**
	 * get the fdMonth
	 * 
	 * @return the fdMonth
	 */
	public String getFdMonth() {
		return this.fdMonth;
	}

	/**
	 * set the fdMonth
	 */
	public void setFdMonth(String fdMonth) {
		this.fdMonth = fdMonth;
	}

	/**
	 * get the fdPlanSum
	 * 
	 * @return the fdPlanSum
	 */
	public BigDecimal getFdPlanSum() {
		return this.fdPlanSum;
	}

	/**
	 * set the fdPlanSum
	 */
	public void setFdPlanSum(BigDecimal fdPlanSum) {
		this.fdPlanSum = fdPlanSum;
	}

	/**
	 * get the fdActualSum
	 * 
	 * @return the fdActualSum
	 */
	public BigDecimal getFdActualSum() {
		return this.fdActualSum;
	}

	/**
	 * set the fdActualSum
	 */
	public void setFdActualSum(BigDecimal fdActualSum) {
		this.fdActualSum = fdActualSum;
	}

	/**
	 * get the fdRate
	 * 
	 * @return the fdRate
	 */
	public BigDecimal getFdRate() {
		return this.fdRate;
	}

	/**
	 * set the fdRate
	 */
	public void setFdRate(BigDecimal fdRate) {
		this.fdRate = fdRate;
	}

	/**
	 * set the fdParentId
	 */
	public void setFdParentId(String fdParentId) {
		this.fdParentId = fdParentId;
	}

	/**
	 * get the fdParentId
	 * 
	 * @return the fdParentId
	 */
	public String getFdParentId() {
		return this.fdParentId;
	}

	/**
	 * set the fdName
	 */
	public void setFdName(String fdName) {
		this.fdName = fdName;
	}

	/**
	 * get the fdName
	 * 
	 * @return the fdName
	 */
	public String getFdName() {
		return this.fdName;
	}

	/**
	 * get the value from Map
	 */
	@SuppressWarnings("rawtypes")
	public void fromMap(Map map) {

		setFdKeyId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdKeyId")), fdKeyId));
		setfdDepartmentId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdDepartmentId")), fdDepartmentId));
		setFdDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdDate")), fdDate));
		setFdFromDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdFromDate")), fdFromDate));
		setFdToDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdToDate")), fdToDate));
		setFdDataType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdDataType")), fdDataType));
		setDisplayName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("displayName")), displayName));

		setFdYear(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdYear")), fdYear));
		setFdMonth(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdMonth")), fdMonth));
		setFdPlanSum(NumberUtils.toBigDecimal(StringUtils.toString(map.get("fdPlanSum")), fdPlanSum));
		setFdActualSum(NumberUtils.toBigDecimal(StringUtils.toString(map.get("fdActualSum")), fdActualSum));
		setFdRate(NumberUtils.toBigDecimal(StringUtils.toString(map.get("fdRate")), fdRate));

		setFdParentId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdParentId")), fdParentId));
		setFdName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdName")), fdName));

	}

	/**
	 * set the value to Map
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map toMap() {

		Map map = new HashMap();
		map.put("fdKeyId", StringUtils.toString(fdKeyId, eiMetadata.getMeta("fdKeyId")));
		map.put("fdDepartmentId", StringUtils.toString(fdDepartmentId, eiMetadata.getMeta("fdDepartmentId")));
		map.put("fdDate", StringUtils.toString(fdDate, eiMetadata.getMeta("fdDate")));
		map.put("fdFromDate", StringUtils.toString(fdFromDate, eiMetadata.getMeta("fdFromDate")));
		map.put("fdToDate", StringUtils.toString(fdToDate, eiMetadata.getMeta("fdToDate")));
		map.put("fdDataType", StringUtils.toString(fdDataType, eiMetadata.getMeta("fdDataType")));
		map.put("displayName", StringUtils.toString(displayName, eiMetadata.getMeta("displayName")));

		map.put("fdYear", StringUtils.toString(fdYear, eiMetadata.getMeta("fdYear")));
		map.put("fdMonth", StringUtils.toString(fdMonth, eiMetadata.getMeta("fdMonth")));
		map.put("fdPlanSum", StringUtils.toString(fdPlanSum, eiMetadata.getMeta("fdPlanSum")));
		map.put("fdActualSum", StringUtils.toString(fdActualSum, eiMetadata.getMeta("fdActualSum")));
		map.put("fdRate", StringUtils.toString(fdRate, eiMetadata.getMeta("fdRate")));

		map.put("fdParentId", StringUtils.toString(fdParentId, eiMetadata.getMeta("fdParentId")));
		map.put("fdName", StringUtils.toString(fdName, eiMetadata.getMeta("fdName")));

		return map;

	}
}